From 654ca34d02607123f1e37471cb49a488c1cd1b10 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 24 Jul 2005 23:40:14 +0000 Subject: [PATCH] add hostname to dhcp client request SVN-Revision: 1541 --- openwrt/target/default/target_skeleton/sbin/ifup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openwrt/target/default/target_skeleton/sbin/ifup b/openwrt/target/default/target_skeleton/sbin/ifup index 5dac3f9987..8f55ce3e0b 100755 --- a/openwrt/target/default/target_skeleton/sbin/ifup +++ b/openwrt/target/default/target_skeleton/sbin/ifup @@ -50,7 +50,11 @@ case "$if_proto" in ;; dhcp) ip=$(nvram get ${type}_ipaddr) - ${DEBUG:-eval} "udhcpc -R -i $if ${ip:+-r $ip} -b -p $pidfile &" + DHCP_ARGS="-R -i $if ${ip:+-r $ip} -b -p $pidfile" + DHCP_HOSTNAME=$(nvram get ${type}_hostname) + DHCP_HOSTNAME=${DHCP_HOSTNAME%%.*} + [ -z $DHCP_HOSTNAME ] || DHCP_ARGS="$DHCP_ARGS -H $DHCP_HOSTNAME" + ${DEBUG:-eval} "udhcpc $DHCP_ARGS &" ;; none|"") ;; -- 2.30.2